<div>
<div class="page-add-new-article page-banner-management">
    <div id="content-header">
        <h1>Xem đơn hàng Mã số <?php echo $order['Order']['id']?></h1>
    </div>
    <div class="container-fluid">
     <div class="row-fluid">
      <div class="span12">
        
        <?php
            echo $this->Form->create('Order', array('id' => 'paginate','class'=>'form-horizontal'));
        ?>	
            <div class="widget-box widget-content-no-padding">
                <?php //echo $this->Session->flash(); ?>
                <div class="control-group item-group">
                    <label for="NodeTitle" class="control-label">Người đặt hàng</label>
                    <div class="controls"><input readonly type="text" value="<?php echo $order['User']['fullname']?>" id="NodeTitle"></div>
                </div>
                <div class="control-group item-group">
                    <label for="NodeTitle" class="control-label">Giá trị đơn hàng</label>
                    <div class="controls"><input readonly type="text" value="<?php echo $this->Currency->formatCurrency($order['Order']['sum'])?>" id="NodeTitle"></div>
                </div>
                <div class="control-group item-group">
                    <label for="NodeTitle" class="control-label">Thời gian tạo</label>
                    <div class="controls"><input readonly type="text" value="<?php echo date('G:i d-m-Y',$order['Order']['created'])?>" id="NodeTitle"></div>
                </div>
                <div class="control-group item-group">
                    <label for="NodeTitle" class="control-label">Thời gian nhận hàng</label>
                    <div class="controls"><input readonly type="text" value="<?php echo $order['Order']['time']?>" id="NodeTitle"></div>
                </div>
                <div class="control-group item-group">
                    <label for="NodeTitle" class="control-label">Số điện thoại</label>
                    <div class="controls"><input readonly type="text" value="<?php echo $user['Information']['phone']?>" id="NodeTitle"></div>
                </div>
                <div class="control-group item-group">
                    <label for="NodeTitle" class="control-label">Email liên hệ</label>
                    <div class="controls"><input readonly type="text" value="<?php echo $user['Information']['email']?>" id="NodeTitle"></div>
                </div>
                <div class="clear"></div>
                <div class="control-group">
                    <div class="item-row">
                        <label for="NodeIsPublished" class="control-label">Đã xác nhận</label>
                        <div class="controls">
                            <?php echo $this->Form->checkbox('is_confirmed',array('label'=>false))?>
                        </div>
                    </div>
                    <div class="item-row">
                        <label for="NodeIsPublished" class="control-label">Đã thanh toán</label>
                        <div class="controls">
                            <?php echo $this->Form->checkbox('is_paid',array('label'=>false))?>
                        </div>
                    </div>
                    <div class="item-row">
                        <label for="NodeIsPublished" class="control-label">Đã nhận hàng</label>
                        <div class="controls">
                            <?php echo $this->Form->checkbox('is_received',array('label'=>false))?>
                        </div>
                    </div>
                    <div class="item-row">
                        <label for="NodeIsPublished" class="control-label">Không xác nhận</label>
                        <div class="controls">
                            <?php echo $this->Form->checkbox('is_invalid',array('label'=>false))?>
                        </div>
                    </div>
                    <div class="clear"></div>
                    
                </div>
            </div>
            <div class="form-actions form-actions-two">
                <p class="txtleft">
                    <button  class="btn btn-inverse"><i class="icon-save">&nbsp;</i>Lưu</button>
                    <a href="/admin/node/node/order_index">
                        <button type="button" class="btn  btn-danger"><i class="icon-remove icon-white">&nbsp;</i>Hủy</button>
                    </a>        
                </p>
            </div> 
        <?php
            echo $this->Form->end();
        ?>        									
    </div>	
</div>
</div>
</div>
<div class="container-fluid">
    <div class="widget-box widget-content-no-padding">
            <!--For manage node normal-->
            <div class="widget-content widget-content-two">
                
                <table class="table table-bordered  table-striped wd-hover-btn" style="margin-top: 10px;">
                    <thead>
						<tr>
                            <th width="5%">STT</th>
                            <th style="text-align:left">Sản phẩm</th>
                            <th>Giá</th>
                            <th>Số lượng</th>
                            <th>Thành tiền</th>
                            <th>Thao tác</th>
						</tr>
					</thead>
                    <tbody id="tbody-index">
                        
                        <?php    $count=1;
                            foreach ($order['Item'] as $data) : ?>                                            
                            <tr>
                                <td><?php echo $count++?></td>                   
                                <td><?php echo $data['name']?></td>                                
                                <td><?php echo $this->Currency->formatCurrency($data['price'])?></td>
                                <td><input value="<?php echo $data['number']?>" class="input-item" id="item-value-<?php echo $data['id']?>" maxlength="4"> kg</td>
                                <td><?php echo $this->Currency->formatCurrency($data['sum'])?></td>
                                <td width="16%"><ul>
                                        <li class="wd-icon-3"><button data-target="#s<?php echo $data['id']?>" data-toggle="modal" class="btn btn-mini btn-inverse"><i class="icon-save"></i> <?php echo __d('system','Save');?></button></li>
                                        <li class="wd-icon-3"><button data-target="#d<?php echo $data['id']?>" data-toggle="modal" class="btn btn-mini"><i class="icon-remove"></i> <?php echo __d('system','Delete');?></button></li>
                                    </ul>
                                </td>
                            </tr>

                            <?php endforeach?>                        
                    </tbody>
                    
                </table>			
                <?php  foreach ($order['Item'] as $data) : ?> 
                    <div id="s<?php echo $data['id']?>" class="modal hide">
                        <div class="modal-header">
                            <button data-dismiss="modal" class="close" type="button">×</button>
                            <h3>Thông báo</h3>
                        </div>
                        <div class="modal-body">
                            <p>Bạn có muốn thay đổi số lượng sản phẩm <?php echo $data['name']?> ?</p>
                        </div>
                        <div class="modal-footer">
                            <a data-dismiss="modal" class="btn" href="#">Hủy </a>
                            <a class="btn btn-danger edit-item" id="as<?php echo $data['id']?>" >Lưu </a>
                        </div>
                    </div>
                    <div id="d<?php echo $data['id']?>" class="modal hide">
                        <div class="modal-header">
                            <button data-dismiss="modal" class="close" type="button">×</button>
                            <h3>Thông báo</h3>
                        </div>
                        <div class="modal-body">
                            <p>Bạn có chắc chắn xóa sản phẩm <?php echo $data['name']?> ?</p>
                        </div>
                        <div class="modal-footer">
                            <a data-dismiss="modal" class="btn" href="#">Hủy </a>
                            <a class="btn btn-danger delete-item" id="ad<?php echo $data['id']?>" >Xóa</a>
                        </div>
                    </div>
                <?php endforeach?>        				
            </div>
            <!--End-->
            
        </div>
</div>
<style type="text/css">
    .wd-group-user,.wd-group-checked{border:none;border-bottom: 1px solid #ccc;border-top: 1px solid #ccc;padding-top: 0px;}
</style>